#include "StdAfx.h"

#include "NodeSorter.h"
#include "ColumnTreeData.h"

typedef System::Windows::Forms::TreeNode TreeNodeUI;

using namespace System;
using namespace Bearinglib; 

using namespace ColumnTreeData; 


int NodeSorter::Compare( Object^ x, Object^ y )
{
	TreeNodeUI^ tx = (TreeNodeUI^)x;
	TreeNodeUI^ ty = (TreeNodeUI^)y;

	Group ^ arpX = safe_cast<Group ^>(tx->Tag);


	Group ^ arpY = safe_cast<Group ^>(ty->Tag);

	System::Int32 a = arpX->m_grop->index__;
	return a.CompareTo(arpY->m_grop->index__);

	//return (arpX->m_grop->index__ - arpY->m_grop->index__);
}

